package engine.newUi
{
	import engine.control.loading.MultLoader;
	import engine.data.ResPath;
	import engine.ui.lite.BaseUI;
	
	import flash.display.DisplayObjectContainer;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	
	import newx.com.control.NxClip;
	import newx.com.control.button.NxButton;
	import newx.com.control.text.NxLabel;
	import newx.com.control.text.NxText;
	
	/**
	 *聚宝盆主界面 
	 * @author yangyuechao
	 * 
	 */	
	public class TreasureBowlMainUI extends BaseUI
	{
		private static var _self:TreasureBowlMainUI;
		
		public var icon:NxClip;
		public var shuoming:NxText;
		public var btn1:NxButton;
		public var btn2:NxButton;
		public var btn3:NxButton;
		public var btn4:NxButton;
		
		public var label1_1:NxLabel;
		public var label1_2:NxLabel;
		public var label2_1:NxLabel;
		public var label2_2:NxLabel;
		public var label3_1:NxLabel;
		public var label3_2:NxLabel;
		public var label4_1:NxLabel;
		public var label4_2:NxLabel;
		
		public var mc1:MovieClip;
		public var mc2:MovieClip;
		public var mc3:MovieClip;
		public var mc4:MovieClip;
		public var mc5:MovieClip;
		public var mc6:MovieClip;
		public var mc7:MovieClip;
		public var mc8:MovieClip;
		public var mc9:MovieClip;
		public var wzBg:Sprite;
		
//		public var vip:NxButton ; 
		
		public static function getInstance():TreasureBowlMainUI
		{
			if(_self == null){
				_self = new TreasureBowlMainUI();
			}
			return _self;
		}
		
		public function TreasureBowlMainUI(popupUI:Boolean=true)
		{
			super(popupUI);
		}
		
		override public function Init():void
		{
			TreasureBowlMainLogic.getInstance().Init();
		}
		
		override protected function BeforeShow():void
		{
			TreasureBowlMainLogic.getInstance().beforeShow();
		}
		
		override protected function AfterHide():void
		{
			TreasureBowlMainLogic.getInstance().afterHide();
		}
		
		override public function show(space:DisplayObjectContainer=null, onshow:Function=null, ...argc):void
		{
//			if(!MultLoader.getInstance().hasSourceByUrl(ResPath.PNG + "jubaopenBG.png")){
				MultLoader.getInstance().load([ResPath.PNG + "jubaopenBG.png"], true, createBg);
//			} else {
//				createBg();
//			}
		}
		
		private function createBg():void
		{
			icon.source = MultLoader.getInstance().getSourceByUrl(ResPath.PNG + "jubaopenBG.png");
			super.show();
		}
	}
}